import { useState } from 'react'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import './App.css'
import Auth from './components/Auth'
import DailyPlan from './pages/DailyPlan'
import Home from './pages/Home'
import MyLikes from './pages/MyLikes'
import StudyPath from './pages/StudyPath'
import StudyRecord from './pages/StudyRecord'
import UserCenter from './pages/UserCenter'
import UserInfo from './pages/UserInfo'
import Login from './pages/Login'
import Register from './pages/Register'

function App() {
  const [count, setCount] = useState(0)

  return (
    <Router>
      <Routes>
        <Route path="/" element={<Auth />}>
          <Route index element={<Home />}></Route>
          <Route path="center" element={<UserCenter />}>
            <Route path="login" element={<Login />}></Route>
            <Route path="register" element={<Register />}></Route>
            <Route path="info" element={<UserInfo />}></Route>
            <Route path="path" element={<StudyPath />}></Route>
            <Route path="daily" element={<DailyPlan />}></Route>
            <Route path="mylikes" element={<MyLikes />}></Route>
            <Route path="record" element={<StudyRecord />}></Route>
          </Route>
          {/* 这里可以添加404页路由或者跳转到首页 */}
        </Route>
      </Routes>
    </Router>
  )
}

export default App
